package com.zbf.testJSON;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;

import java.util.HashMap;
import java.util.Map;

/**
 * @author: LI-CI-GAO
 * 作者: licigao
 * 日期: 2021/8/21  11:39
 * 描述:
 */
public class TestJSon {


    public static void main(String[] args) {


        String json="{\n" +
                "    \"resourceId\": \"342501\", \n" +
                "    \"properties\": {\n" +
                "        \"process_id\": \"\", \n" +
                "        \"name\": \"\", \n" +
                "        \"documentation\": \"\", \n" +
                "        \"process_author\": \"\", \n" +
                "        \"process_version\": \"\", \n" +
                "        \"process_namespace\": \"http://www.activiti.org/processdef\", \n" +
                "        \"executionlisteners\": \"\", \n" +
                "        \"eventlisteners\": \"\", \n" +
                "        \"signaldefinitions\": \"\", \n" +
                "        \"messagedefinitions\": \"\"\n" +
                "    }, \n" +
                "    \"stencil\": {\n" +
                "        \"id\": \"BPMNDiagram\"\n" +
                "    }, \n" +
                "    \"childShapes\": [\n" +
                "        {\n" +
                "            \"resourceId\": \"sid-1DEDC3B2-6AF2-4339-A98D-CD3943C4C910\", \n" +
                "            \"properties\": {\n" +
                "                \"overrideid\": \"A1\", \n" +
                "                \"name\": \"开始\", \n" +
                "                \"documentation\": \"\", \n" +
                "                \"executionlisteners\": \"\", \n" +
                "                \"initiator\": \"\", \n" +
                "                \"formkeydefinition\": \"\", \n" +
                "                \"formproperties\": \"\"\n" +
                "            }, \n" +
                "            \"stencil\": {\n" +
                "                \"id\": \"StartNoneEvent\"\n" +
                "            }, \n" +
                "            \"childShapes\": [ ], \n" +
                "            \"outgoing\": [\n" +
                "                {\n" +
                "                    \"resourceId\": \"sid-60680F80-426D-4055-9097-ED2CB719310C\"\n" +
                "                }\n" +
                "            ], \n" +
                "            \"bounds\": {\n" +
                "                \"lowerRight\": {\n" +
                "                    \"x\": 116.109375, \n" +
                "                    \"y\": 126\n" +
                "                }, \n" +
                "                \"upperLeft\": {\n" +
                "                    \"x\": 86.109375, \n" +
                "                    \"y\": 96\n" +
                "                }\n" +
                "            }, \n" +
                "            \"dockers\": [ ]\n" +
                "        }, \n" +
                "        {\n" +
                "            \"resourceId\": \"sid-89B8E24A-7FD5-431F-9676-E3DF682EE3C3\", \n" +
                "            \"properties\": {\n" +
                "                \"overrideid\": \"A9\", \n" +
                "                \"name\": \"结束\", \n" +
                "                \"documentation\": \"\", \n" +
                "                \"executionlisteners\": \"\"\n" +
                "            }, \n" +
                "            \"stencil\": {\n" +
                "                \"id\": \"EndNoneEvent\"\n" +
                "            }, \n" +
                "            \"childShapes\": [ ], \n" +
                "            \"outgoing\": [ ], \n" +
                "            \"bounds\": {\n" +
                "                \"lowerRight\": {\n" +
                "                    \"x\": 874.109375, \n" +
                "                    \"y\": 114\n" +
                "                }, \n" +
                "                \"upperLeft\": {\n" +
                "                    \"x\": 846.109375, \n" +
                "                    \"y\": 86\n" +
                "                }\n" +
                "            }, \n" +
                "            \"dockers\": [ ]\n" +
                "        }, \n" +
                "        {\n" +
                "            \"resourceId\": \"sid-CA65EDC5-B6E7-4AC9-A438-E8CF7E1F1C41\", \n" +
                "            \"properties\": {\n" +
                "                \"overrideid\": \"A3\", \n" +
                "                \"name\": \"老师审核\", \n" +
                "                \"documentation\": \"\", \n" +
                "                \"asynchronousdefinition\": \"false\", \n" +
                "                \"exclusivedefinition\": \"false\", \n" +
                "                \"executionlisteners\": \"\", \n" +
                "                \"multiinstance_type\": \"None\", \n" +
                "                \"multiinstance_cardinality\": \"\", \n" +
                "                \"multiinstance_collection\": \"\", \n" +
                "                \"multiinstance_variable\": \"\", \n" +
                "                \"multiinstance_condition\": \"\", \n" +
                "                \"isforcompensation\": \"false\", \n" +
                "                \"usertaskassignment\": \"\", \n" +
                "                \"formkeydefinition\": \"\", \n" +
                "                \"duedatedefinition\": \"\", \n" +
                "                \"prioritydefinition\": \"\", \n" +
                "                \"formproperties\": \"\", \n" +
                "                \"tasklisteners\": \"\"\n" +
                "            }, \n" +
                "            \"stencil\": {\n" +
                "                \"id\": \"UserTask\"\n" +
                "            }, \n" +
                "            \"childShapes\": [ ], \n" +
                "            \"outgoing\": [\n" +
                "                {\n" +
                "                    \"resourceId\": \"sid-5F9054F2-0279-44B5-80C7-EDD8EAA9A651\"\n" +
                "                }\n" +
                "            ], \n" +
                "            \"bounds\": {\n" +
                "                \"lowerRight\": {\n" +
                "                    \"x\": 303.109375, \n" +
                "                    \"y\": 151\n" +
                "                }, \n" +
                "                \"upperLeft\": {\n" +
                "                    \"x\": 203.109375, \n" +
                "                    \"y\": 71\n" +
                "                }\n" +
                "            }, \n" +
                "            \"dockers\": [ ]\n" +
                "        }, \n" +
                "        {\n" +
                "            \"resourceId\": \"sid-0302A2C5-CDAF-4EB5-AB7C-6665215D6C07\", \n" +
                "            \"properties\": {\n" +
                "                \"overrideid\": \"A5\", \n" +
                "                \"name\": \"领导审核\", \n" +
                "                \"documentation\": \"\", \n" +
                "                \"asynchronousdefinition\": \"false\", \n" +
                "                \"exclusivedefinition\": \"false\", \n" +
                "                \"executionlisteners\": \"\", \n" +
                "                \"multiinstance_type\": \"None\", \n" +
                "                \"multiinstance_cardinality\": \"\", \n" +
                "                \"multiinstance_collection\": \"\", \n" +
                "                \"multiinstance_variable\": \"\", \n" +
                "                \"multiinstance_condition\": \"\", \n" +
                "                \"isforcompensation\": \"false\", \n" +
                "                \"usertaskassignment\": \"\", \n" +
                "                \"formkeydefinition\": \"\", \n" +
                "                \"duedatedefinition\": \"\", \n" +
                "                \"prioritydefinition\": \"\", \n" +
                "                \"formproperties\": \"\", \n" +
                "                \"tasklisteners\": \"\"\n" +
                "            }, \n" +
                "            \"stencil\": {\n" +
                "                \"id\": \"UserTask\"\n" +
                "            }, \n" +
                "            \"childShapes\": [ ], \n" +
                "            \"outgoing\": [\n" +
                "                {\n" +
                "                    \"resourceId\": \"sid-3726BB6B-FABE-489C-BB36-F564EED21544\"\n" +
                "                }\n" +
                "            ], \n" +
                "            \"bounds\": {\n" +
                "                \"lowerRight\": {\n" +
                "                    \"x\": 491.109375, \n" +
                "                    \"y\": 151\n" +
                "                }, \n" +
                "                \"upperLeft\": {\n" +
                "                    \"x\": 391.109375, \n" +
                "                    \"y\": 71\n" +
                "                }\n" +
                "            }, \n" +
                "            \"dockers\": [ ]\n" +
                "        }, \n" +
                "        {\n" +
                "            \"resourceId\": \"sid-793A3920-4978-45F1-8335-0FF727EA6554\", \n" +
                "            \"properties\": {\n" +
                "                \"overrideid\": \"A7\", \n" +
                "                \"name\": \"领导的领导神格\", \n" +
                "                \"documentation\": \"\", \n" +
                "                \"asynchronousdefinition\": \"false\", \n" +
                "                \"exclusivedefinition\": \"false\", \n" +
                "                \"executionlisteners\": \"\", \n" +
                "                \"multiinstance_type\": \"None\", \n" +
                "                \"multiinstance_cardinality\": \"\", \n" +
                "                \"multiinstance_collection\": \"\", \n" +
                "                \"multiinstance_variable\": \"\", \n" +
                "                \"multiinstance_condition\": \"\", \n" +
                "                \"isforcompensation\": \"false\", \n" +
                "                \"usertaskassignment\": \"\", \n" +
                "                \"formkeydefinition\": \"\", \n" +
                "                \"duedatedefinition\": \"\", \n" +
                "                \"prioritydefinition\": \"\", \n" +
                "                \"formproperties\": \"\", \n" +
                "                \"tasklisteners\": \"\"\n" +
                "            }, \n" +
                "            \"stencil\": {\n" +
                "                \"id\": \"UserTask\"\n" +
                "            }, \n" +
                "            \"childShapes\": [ ], \n" +
                "            \"outgoing\": [\n" +
                "                {\n" +
                "                    \"resourceId\": \"sid-009E4C72-7BC4-4B4A-B61D-9922E7B7F05A\"\n" +
                "                }\n" +
                "            ], \n" +
                "            \"bounds\": {\n" +
                "                \"lowerRight\": {\n" +
                "                    \"x\": 670, \n" +
                "                    \"y\": 140\n" +
                "                }, \n" +
                "                \"upperLeft\": {\n" +
                "                    \"x\": 570, \n" +
                "                    \"y\": 60\n" +
                "                }\n" +
                "            }, \n" +
                "            \"dockers\": [ ]\n" +
                "        }, \n" +
                "        {\n" +
                "            \"resourceId\": \"sid-60680F80-426D-4055-9097-ED2CB719310C\", \n" +
                "            \"properties\": {\n" +
                "                \"overrideid\": \"A2\", \n" +
                "                \"name\": \"\", \n" +
                "                \"documentation\": \"\", \n" +
                "                \"conditionsequenceflow\": \"\", \n" +
                "                \"executionlisteners\": \"\", \n" +
                "                \"defaultflow\": \"false\"\n" +
                "            }, \n" +
                "            \"stencil\": {\n" +
                "                \"id\": \"SequenceFlow\"\n" +
                "            }, \n" +
                "            \"childShapes\": [ ], \n" +
                "            \"outgoing\": [\n" +
                "                {\n" +
                "                    \"resourceId\": \"sid-CA65EDC5-B6E7-4AC9-A438-E8CF7E1F1C41\"\n" +
                "                }\n" +
                "            ], \n" +
                "            \"bounds\": {\n" +
                "                \"lowerRight\": {\n" +
                "                    \"x\": 202.234375, \n" +
                "                    \"y\": 111\n" +
                "                }, \n" +
                "                \"upperLeft\": {\n" +
                "                    \"x\": 116.359375, \n" +
                "                    \"y\": 111\n" +
                "                }\n" +
                "            }, \n" +
                "            \"dockers\": [\n" +
                "                {\n" +
                "                    \"x\": 15, \n" +
                "                    \"y\": 15\n" +
                "                }, \n" +
                "                {\n" +
                "                    \"x\": 50, \n" +
                "                    \"y\": 40\n" +
                "                }\n" +
                "            ], \n" +
                "            \"target\": {\n" +
                "                \"resourceId\": \"sid-CA65EDC5-B6E7-4AC9-A438-E8CF7E1F1C41\"\n" +
                "            }\n" +
                "        }, \n" +
                "        {\n" +
                "            \"resourceId\": \"sid-5F9054F2-0279-44B5-80C7-EDD8EAA9A651\", \n" +
                "            \"properties\": {\n" +
                "                \"overrideid\": \"A4\", \n" +
                "                \"name\": \"\", \n" +
                "                \"documentation\": \"\", \n" +
                "                \"conditionsequenceflow\": \"\", \n" +
                "                \"executionlisteners\": \"\", \n" +
                "                \"defaultflow\": \"false\"\n" +
                "            }, \n" +
                "            \"stencil\": {\n" +
                "                \"id\": \"SequenceFlow\"\n" +
                "            }, \n" +
                "            \"childShapes\": [ ], \n" +
                "            \"outgoing\": [\n" +
                "                {\n" +
                "                    \"resourceId\": \"sid-0302A2C5-CDAF-4EB5-AB7C-6665215D6C07\"\n" +
                "                }\n" +
                "            ], \n" +
                "            \"bounds\": {\n" +
                "                \"lowerRight\": {\n" +
                "                    \"x\": 390.171875, \n" +
                "                    \"y\": 111\n" +
                "                }, \n" +
                "                \"upperLeft\": {\n" +
                "                    \"x\": 304.046875, \n" +
                "                    \"y\": 111\n" +
                "                }\n" +
                "            }, \n" +
                "            \"dockers\": [\n" +
                "                {\n" +
                "                    \"x\": 50, \n" +
                "                    \"y\": 40\n" +
                "                }, \n" +
                "                {\n" +
                "                    \"x\": 50, \n" +
                "                    \"y\": 40\n" +
                "                }\n" +
                "            ], \n" +
                "            \"target\": {\n" +
                "                \"resourceId\": \"sid-0302A2C5-CDAF-4EB5-AB7C-6665215D6C07\"\n" +
                "            }\n" +
                "        }, \n" +
                "        {\n" +
                "            \"resourceId\": \"sid-3726BB6B-FABE-489C-BB36-F564EED21544\", \n" +
                "            \"properties\": {\n" +
                "                \"overrideid\": \"A6\", \n" +
                "                \"name\": \"\", \n" +
                "                \"documentation\": \"\", \n" +
                "                \"conditionsequenceflow\": \"\", \n" +
                "                \"executionlisteners\": \"\", \n" +
                "                \"defaultflow\": \"false\"\n" +
                "            }, \n" +
                "            \"stencil\": {\n" +
                "                \"id\": \"SequenceFlow\"\n" +
                "            }, \n" +
                "            \"childShapes\": [ ], \n" +
                "            \"outgoing\": [\n" +
                "                {\n" +
                "                    \"resourceId\": \"sid-793A3920-4978-45F1-8335-0FF727EA6554\"\n" +
                "                }\n" +
                "            ], \n" +
                "            \"bounds\": {\n" +
                "                \"lowerRight\": {\n" +
                "                    \"x\": 569.3858032226562, \n" +
                "                    \"y\": 111\n" +
                "                }, \n" +
                "                \"upperLeft\": {\n" +
                "                    \"x\": 491.72357177734375, \n" +
                "                    \"y\": 100\n" +
                "                }\n" +
                "            }, \n" +
                "            \"dockers\": [\n" +
                "                {\n" +
                "                    \"x\": 50, \n" +
                "                    \"y\": 40\n" +
                "                }, \n" +
                "                {\n" +
                "                    \"x\": 530.5546875, \n" +
                "                    \"y\": 111\n" +
                "                }, \n" +
                "                {\n" +
                "                    \"x\": 530.5546875, \n" +
                "                    \"y\": 100\n" +
                "                }, \n" +
                "                {\n" +
                "                    \"x\": 50, \n" +
                "                    \"y\": 40\n" +
                "                }\n" +
                "            ], \n" +
                "            \"target\": {\n" +
                "                \"resourceId\": \"sid-793A3920-4978-45F1-8335-0FF727EA6554\"\n" +
                "            }\n" +
                "        }, \n" +
                "        {\n" +
                "            \"resourceId\": \"sid-009E4C72-7BC4-4B4A-B61D-9922E7B7F05A\", \n" +
                "            \"properties\": {\n" +
                "                \"overrideid\": \"A8\", \n" +
                "                \"name\": \"\", \n" +
                "                \"documentation\": \"\", \n" +
                "                \"conditionsequenceflow\": \"\", \n" +
                "                \"executionlisteners\": \"\", \n" +
                "                \"defaultflow\": \"false\"\n" +
                "            }, \n" +
                "            \"stencil\": {\n" +
                "                \"id\": \"SequenceFlow\"\n" +
                "            }, \n" +
                "            \"childShapes\": [ ], \n" +
                "            \"outgoing\": [\n" +
                "                {\n" +
                "                    \"resourceId\": \"sid-89B8E24A-7FD5-431F-9676-E3DF682EE3C3\"\n" +
                "                }\n" +
                "            ], \n" +
                "            \"bounds\": {\n" +
                "                \"lowerRight\": {\n" +
                "                    \"x\": 845.9783935546875, \n" +
                "                    \"y\": 100\n" +
                "                }, \n" +
                "                \"upperLeft\": {\n" +
                "                    \"x\": 670.7101440429688, \n" +
                "                    \"y\": 100\n" +
                "                }\n" +
                "            }, \n" +
                "            \"dockers\": [\n" +
                "                {\n" +
                "                    \"x\": 50, \n" +
                "                    \"y\": 40\n" +
                "                }, \n" +
                "                {\n" +
                "                    \"x\": 14, \n" +
                "                    \"y\": 14\n" +
                "                }\n" +
                "            ], \n" +
                "            \"target\": {\n" +
                "                \"resourceId\": \"sid-89B8E24A-7FD5-431F-9676-E3DF682EE3C3\"\n" +
                "            }\n" +
                "        }\n" +
                "    ], \n" +
                "    \"bounds\": {\n" +
                "        \"lowerRight\": {\n" +
                "            \"x\": 1200, \n" +
                "            \"y\": 1050\n" +
                "        }, \n" +
                "        \"upperLeft\": {\n" +
                "            \"x\": 0, \n" +
                "            \"y\": 0\n" +
                "        }\n" +
                "    }, \n" +
                "    \"stencilset\": {\n" +
                "        \"url\": \"stencilsets/bpmn2.0/bpmn2.0.json\", \n" +
                "        \"namespace\": \"http://b3mn.org/stencilset/bpmn2.0#\"\n" +
                "    }, \n" +
                "    \"ssextensions\": [ ]\n" +
                "}";


        JSONObject jsonObject = JSON.parseObject(json);
        JSONArray childShapes = jsonObject.getJSONArray("childShapes");
        for (Object childShape : childShapes) {
            JSONObject jsonObject1 = JSON.parseObject(JSON.toJSONString(childShape));
            JSONObject properties = jsonObject1.getJSONObject("properties");
            System.out.println("=========="+properties.getString("name"));
        }


        Map<String,Object> map=new HashMap<>();

        JSON.toJSONString(map);


    }


}
